import request from '@/utils/request'

function saveRolePermissions(data) {
  return request({
    url: `/admin/sysAuth/role/saveRolePermissions`,
    method: 'post',
    data
  })
}

function findAllPermissions() {
  return request({
    url: `/admin/sysAuth/permission/findAllPermissions`
  })
}

function updateRolePermissions(data) {
  return request({
    url: '/admin/sysAuth/role/updateRolePermissions',
    method: 'put',
    data
  })
}

function findRolePermissions(id) {
  return request({
    url: `/admin/sysAuth/role/findRolePermissions/${id}`
  })
}

function removeRole(id) {
  return request({
    url: `/admin/sysAuth/role/removeRole/${id}`,
    method: 'delete'
  })
}
export {
  saveRolePermissions,
  findAllPermissions,
  findRolePermissions,
  updateRolePermissions,
  removeRole
}
